/*
 * TestFul - http://code.google.com/p/testful/
 * Copyright (C) 2010  Matteo Miraz
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package instrumentation;

import java.io.Serializable;

import soot.SootMethod;


public abstract class Condition  implements Serializable{


	public enum DataType {
		Boolean, Character, Number, String, Array, Reference
	}

	private final int branchId;
	private final int switchCaseId;
	private final String method;
	private final String cName;
	private final DataType dataType;
	private final String callee1;
	private final String callee2;
	private final Value v1;
	private final boolean callMethod; 
	private final Value v2;
	private final boolean isPrivate;
	private final String extraInfo;
	public Condition(int branchId,String cName,String method,boolean isPrivate,boolean callMethod, DataType dataType,String callee1, 
				Value v1,String callee2,  Value v2,String extraInfo) {
		this.branchId = branchId;
		this.switchCaseId =-1;
		this.cName=cName;
		this.method=method;
		this.dataType = dataType;
		this.callee1=callee1;
		this.v1 = v1;
		this.callee2=callee2;
		this.v2 = v2;
		this.isPrivate=isPrivate;
		this.callMethod=callMethod;
		this.extraInfo=extraInfo;
	}
	public Condition(int switchCaseId,String cName,String method,boolean isPrivate,Value v1,DataType dataType){
		this.switchCaseId = switchCaseId;
		this.branchId = -1;
		this.cName=cName;
		this.method=method;
		this.dataType = dataType;
		this.callee1="";
		this.v1 = v1;
		this.callee2="";
		this.v2 = null;
		this.isPrivate=isPrivate;		
		this.callMethod=false;
		this.extraInfo=null;
	}
	public int getBranchId() {
		return branchId;
	}
	public boolean getIsPrivate() {
		return isPrivate;
	}
	public boolean getIsCallMethod() {
		return callMethod;
	}
	
	public String getCName(){
		return this.cName;
	}
public String  getMName(){
		return this.method;
	}
	public DataType getType() {
		return dataType;
	}
	public String getCallee1() {
		return callee1;
	}

	/**
	 * @return the 1st value
	 */
	public Value getV1() {
		return v1;
	}
	public String getCallee2() {
		return callee2;
	}
	/**
	 * @return the 2nd value
	 */
	public Value getV2() {
		return v2;
	}
	public String getExtraInfo() {
		return extraInfo;
	}

}
